package com.hu.config.redis;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class TokenCache extends RedisCache{
    private final static String KEY = "token:";
    @Autowired
    private StringRedisTemplate redisTemplate;

    @Override
    public String get(String id) {
        return redisTemplate.opsForValue().get(KEY + id);
    }

    @Override
    public void set(String id, Object obj) {
        redisTemplate.opsForValue().set(KEY + id,obj.toString());
    }
}
